$(function(


  var storage = new (function () {
    this.setLocal = function(key, val){
      localStorage.setItem(key, val);
    }

    this.setLocalObject = function(key, obj){
      localStorage.setItem(key, JSON.stringify(obj));
    }

    this.getLocal = function(key){
      return localStorage.getItem(key);
    }

    this.getLocalObject = function(key){
      return JSON.parse(localStorage.getItem(key));
    }

    this.removeLocal = function(key){
      localStorage.removeItem(key);
    }

    this.setSession = function(key, val){
      sessionStorage.setItem(key, val);
    }

    this.setSessionObject = function(key, obj){
      sessionStorage.setItem(key, JSON.stringify(obj));
    }

    this.getSession = function(key){
      return sessionStorage.getItem(key);
    }

    this.getSessionObject = function(key){
      return JSON.parse(sessionStorage.getItem(key));
    }

    this.removeSession = function(key){
      sessionStorage.removeItem(key);
    }
  });



));
